import allure
from selenium.webdriver.common.by import By

from wewrok_app_po.Base.wework_app import WeWorkApp
from wewrok_app_po.Page.manual_input_page import ManualInputPage


class AddMemberPage(WeWorkApp):
    # def __init__(self, driver:WebDriver):
    #     self.driver = driver
    _MANUAL_INPUT = By.XPATH, "//*[@text = '手动输入添加']"

    def goto_manual_input_page(self):
        # 点击手动输入添加
        # 点击手动输入添加
        with allure.step("点击手动添加按钮"):
            self.find_and_click(*self._MANUAL_INPUT)
        # 进入手动加添页面
        return ManualInputPage(self.driver)
    # 获取toast内容

    def get_toast_tips(self):
        # 获取toast
        # tipe = self.driver.find_element(By.XPATH, "//*[@text = '添加成功']").text
        with allure.step("获取toast文本"):
            return self.get_toast_text()